/*
 * Client.h
 *
 *  Created on: 2009-01-10
 *      Author: tomaszd
 */

#ifndef CLIENT_H_
#define CLIENT_H_

#include "../udp-server/structs.h"
#include "../CommunicationStructs.h"

class UdpClient {
public:
	struct sockaddr_in server_addr, game_addr, client_addr;
	struct ip_mreq mreq;
	struct timeval tv;
	int addr_len;
	socklen_t slen;
	int sh, sd;
	struct options client_options;
        ClientComunicationStruct player_decl;
        SharedMemStruct shared_serv_mem;
	struct init init_struct;
	struct map game_map;
	struct move player_move;
	struct moves players_moves;

	UdpClient();
	virtual ~UdpClient();

	void client_config(char * path_to_conf);
	void submit_player();
	bool connect_to_game();
	void receive(char *str, unsigned long int size);
	void send(char *str, unsigned long int size);
};

#endif /* CLIENT_H_ */
